package com.smartbus.bus.domain;

import java.math.BigDecimal;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 换乘路径结果对象
 *
 * @author smartbus
 * @date 2024-09-24
 */
public class TransferRoute
{
    /** 起始站点ID */
    private Long fromStationId;

    /** 起始站点名称 */
    private String fromStationName;

    /** 目标站点ID */
    private Long toStationId;

    /** 目标站点名称 */
    private String toStationName;

    /** 换乘方案列表 */
    private List<TransferPlan> transferPlans;

    /** 查询耗时（毫秒） */
    private Long queryTime;

    public TransferRoute() {}

    public TransferRoute(Long fromStationId, String fromStationName, Long toStationId, String toStationName) {
        this.fromStationId = fromStationId;
        this.fromStationName = fromStationName;
        this.toStationId = toStationId;
        this.toStationName = toStationName;
    }

    public Long getFromStationId() {
        return fromStationId;
    }

    public void setFromStationId(Long fromStationId) {
        this.fromStationId = fromStationId;
    }

    public String getFromStationName() {
        return fromStationName;
    }

    public void setFromStationName(String fromStationName) {
        this.fromStationName = fromStationName;
    }

    public Long getToStationId() {
        return toStationId;
    }

    public void setToStationId(Long toStationId) {
        this.toStationId = toStationId;
    }

    public String getToStationName() {
        return toStationName;
    }

    public void setToStationName(String toStationName) {
        this.toStationName = toStationName;
    }

    public List<TransferPlan> getTransferPlans() {
        return transferPlans;
    }

    public void setTransferPlans(List<TransferPlan> transferPlans) {
        this.transferPlans = transferPlans;
    }

    public Long getQueryTime() {
        return queryTime;
    }

    public void setQueryTime(Long queryTime) {
        this.queryTime = queryTime;
    }

    /**
     * 换乘方案
     */
    public static class TransferPlan {
        /** 方案ID */
        private Integer planId;

        /** 换乘次数 */
        private Integer transferCount;

        /** 总距离（公里） */
        private BigDecimal totalDistance;

        /** 总时间（分钟） */
        private Integer totalTime;

        /** 步行距离（公里） */
        private BigDecimal walkingDistance;

        /** 步行时间（分钟） */
        private Integer walkingTime;

        /** 线路段列表 */
        private List<RouteSegment> routeSegments;

        /** 推荐度评分（0-100） */
        private Integer recommendScore;

        /** 方案类型（1-最少换乘，2-最短时间，3-最短距离） */
        private Integer planType;

        public Integer getPlanId() {
            return planId;
        }

        public void setPlanId(Integer planId) {
            this.planId = planId;
        }

        public Integer getTransferCount() {
            return transferCount;
        }

        public void setTransferCount(Integer transferCount) {
            this.transferCount = transferCount;
        }

        public BigDecimal getTotalDistance() {
            return totalDistance;
        }

        public void setTotalDistance(BigDecimal totalDistance) {
            this.totalDistance = totalDistance;
        }

        public Integer getTotalTime() {
            return totalTime;
        }

        public void setTotalTime(Integer totalTime) {
            this.totalTime = totalTime;
        }

        public BigDecimal getWalkingDistance() {
            return walkingDistance;
        }

        public void setWalkingDistance(BigDecimal walkingDistance) {
            this.walkingDistance = walkingDistance;
        }

        public Integer getWalkingTime() {
            return walkingTime;
        }

        public void setWalkingTime(Integer walkingTime) {
            this.walkingTime = walkingTime;
        }

        public List<RouteSegment> getRouteSegments() {
            return routeSegments;
        }

        public void setRouteSegments(List<RouteSegment> routeSegments) {
            this.routeSegments = routeSegments;
        }

        public Integer getRecommendScore() {
            return recommendScore;
        }

        public void setRecommendScore(Integer recommendScore) {
            this.recommendScore = recommendScore;
        }

        public Integer getPlanType() {
            return planType;
        }

        public void setPlanType(Integer planType) {
            this.planType = planType;
        }
    }

    /**
     * 线路段（一段不需要换乘的路线）
     */
    public static class RouteSegment {
        /** 段序号 */
        private Integer segmentOrder;

        /** 线路ID */
        private Long routeId;

        /** 线路编号 */
        private String routeCode;

        /** 线路名称 */
        private String routeName;

        /** 上车站点ID */
        private Long boardStationId;

        /** 上车站点名称 */
        private String boardStationName;

        /** 下车站点ID */
        private Long alightStationId;

        /** 下车站点名称 */
        private String alightStationName;

        /** 段距离（公里） */
        private BigDecimal segmentDistance;

        /** 段时间（分钟） */
        private Integer segmentTime;

        /** 经过站点数 */
        private Integer stationCount;

        /** 换乘类型（0-起始，1-换乘，2-步行换乘） */
        private Integer transferType;

        /** 换乘步行距离（公里，仅步行换乘时有值） */
        private BigDecimal transferWalkDistance;

        /** 换乘步行时间（分钟，仅步行换乘时有值） */
        private Integer transferWalkTime;

        public Integer getSegmentOrder() {
            return segmentOrder;
        }

        public void setSegmentOrder(Integer segmentOrder) {
            this.segmentOrder = segmentOrder;
        }

        public Long getRouteId() {
            return routeId;
        }

        public void setRouteId(Long routeId) {
            this.routeId = routeId;
        }

        public String getRouteCode() {
            return routeCode;
        }

        public void setRouteCode(String routeCode) {
            this.routeCode = routeCode;
        }

        public String getRouteName() {
            return routeName;
        }

        public void setRouteName(String routeName) {
            this.routeName = routeName;
        }

        public Long getBoardStationId() {
            return boardStationId;
        }

        public void setBoardStationId(Long boardStationId) {
            this.boardStationId = boardStationId;
        }

        public String getBoardStationName() {
            return boardStationName;
        }

        public void setBoardStationName(String boardStationName) {
            this.boardStationName = boardStationName;
        }

        public Long getAlightStationId() {
            return alightStationId;
        }

        public void setAlightStationId(Long alightStationId) {
            this.alightStationId = alightStationId;
        }

        public String getAlightStationName() {
            return alightStationName;
        }

        public void setAlightStationName(String alightStationName) {
            this.alightStationName = alightStationName;
        }

        public BigDecimal getSegmentDistance() {
            return segmentDistance;
        }

        public void setSegmentDistance(BigDecimal segmentDistance) {
            this.segmentDistance = segmentDistance;
        }

        public Integer getSegmentTime() {
            return segmentTime;
        }

        public void setSegmentTime(Integer segmentTime) {
            this.segmentTime = segmentTime;
        }

        public Integer getStationCount() {
            return stationCount;
        }

        public void setStationCount(Integer stationCount) {
            this.stationCount = stationCount;
        }

        public Integer getTransferType() {
            return transferType;
        }

        public void setTransferType(Integer transferType) {
            this.transferType = transferType;
        }

        public BigDecimal getTransferWalkDistance() {
            return transferWalkDistance;
        }

        public void setTransferWalkDistance(BigDecimal transferWalkDistance) {
            this.transferWalkDistance = transferWalkDistance;
        }

        public Integer getTransferWalkTime() {
            return transferWalkTime;
        }

        public void setTransferWalkTime(Integer transferWalkTime) {
            this.transferWalkTime = transferWalkTime;
        }
    }
}